package com.github.bridge.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * @program: signature-bridge-service
 * @description:
 * @author: hui.zhang
 * @date: 2024/8/25 3:47 下午
 **/
@Data
@EqualsAndHashCode(callSuper = true)
public class GeneratePdfFileDTO extends BaseDTO {

    @NotBlank(message = "templateId不能为空")
    @Schema(description = "模板id(己发布的模板id)", requiredMode = Schema.RequiredMode.REQUIRED)
    private String templateId;

    @NotBlank(message = "fileName不能为空")
    @Schema(description = "文件名称(生成文件名称)", requiredMode = Schema.RequiredMode.REQUIRED)
    private String fileName;

    @NotEmpty(message = "contentsControl不能为空")
    @Schema(description = "填充内容", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<GeneratePdfFileContentControl> contentsControl;

    @Data
    public static class GeneratePdfFileContentControl {

        @Schema(description = "模板待填充字段的id 不建议用这个")
        private String contentId;

        @Schema(description = "模板待填充code 和contentId必选一 建议使用这个")
        private String contentCode;

        @Schema(description = "填充code对应的值", requiredMode = Schema.RequiredMode.REQUIRED)
        private String contentValue;
    }
}
